Troubleshooting

argocd admin notifications is a CLI command group that helps to configure the controller settings and troubleshoot issues. Full command details are available in the command reference.

Global flags

The following global flags are available for all sub-commands:

  • --config-map - path to the file containing argocd-notifications-cm ConfigMap. If not specified then the command loads argocd-notification-cm ConfigMap using the local Kubernetes config file.
  • --secret - path to the file containing argocd-notifications-secret ConfigMap. If not specified then the command loads argocd-notification-secret Secret using the local Kubernetes config file. Additionally, you can specify :empty to use empty secret with no notification service settings.

Examples:

  • Get a list of triggers configured in the local config map:

    1. argocd admin notifications trigger get \
    2. --config-map ./argocd-notifications-cm.yaml --secret :empty
  • Trigger notification using in-cluster config map and secret:

    1. argocd admin notifications template notify \
    2. app-sync-succeeded guestbook --recipient slack:argocd admin notifications

Kustomize

If you are managing argocd-notifications config using Kustomize you can pipe whole kustomize build output into stdin using --config-map - flag:

  1. kustomize build ./argocd-notifications | \
  2. argocd-notifications \
  3. template notify app-sync-succeeded guestbook --recipient grafana:argocd \
  4. --config-map -

How to get it

On your laptop

You can download the argocd CLI from the GitHub release attachments.

The binary is available in the quay.io/argoproj/argocd image. Use the docker run and volume mount to execute binary on any platform.

Example:

  1. docker run --rm -it -w /src -v $(pwd):/src \
  2. quay.io/argoproj/argocd:<version> \
  3. /app/argocd admin notifications trigger get \
  4. --config-map ./argocd-notifications-cm.yaml --secret :empty

In your cluster

SSH into the running argocd-notifications-controller pod and use kubectl exec command to validate in-cluster configuration.

Example

  1. kubectl exec -it argocd-notifications-controller-<pod-hash> \
  2. /app/argocd admin notifications trigger get

Commands

The following commands may help debug issues with notifications:

Errors

Failed to parse new settings

error converting YAML to JSON

YAML syntax is incorrect.

incorrect:

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: argocd-notifications-cm
  5. data:
  6. service.slack: |
  7. token: $slack-token
  8. icon: :rocket:

correct:

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: argocd-notifications-cm
  5. data:
  6. service.slack: |
  7. token: $slack-token
  8. icon: ":rocket:"

service type ‘xxxx’ is not supported

You need to check your argocd-notifications controller version. For instance, the teams integration is to support v1.1.0 and more.

Failed to notify recipient

notification service ‘xxxx’ is not supported

You have not defined xxxx in argocd-notifications-cm or to fail to parse settings.

config referenced xxx, but key does not exist in secret

  • If you are using a custom secret, check that the secret is in the same namespace
  • You have added the label: app.kubernetes.io/part-of: argocd to the secret
  • You have tried restarting argocd-notifications controller

Example:

Secret:

  1. apiVersion: v1
  2. kind: Secret
  3. metadata:
  4. name: argocd-slackbot
  5. namespace: <the namespace where argocd is installed>
  6. labels:
  7. app.kubernetes.io/part-of: argocd
  8. type: Opaque
  9. data:
  10. slack-token: <base64encryptedtoken>

ConfigMap

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: argocd-notifications-cm
  5. data:
  6. service.slack: |
  7. token: $argocd-slackbot:slack-token